-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full support for OpenTelemetry tracing, use it instead of XRay in runDB
#120
Conversation
runDB
This is actually a smell, IMO, that I have to deal with this in our own clients, so I'm going to remove the re-exports and see if things work out better. It should mean adding |
This makes it harder for clients to decide between the default OTel tracing vs XRay-based. It was always a bit too opinionated anyway. Having to bring in the Database module only if/when you need it is kind of nice anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel like I'm missing enough xray/otel knowledge to give substantive feedback here, but I think it all makes enough sense.
OK, I tossed in a bunch of packaging fixes. |
This was spiked, implemented, used in platform-example-app, then shelved
because megarepo wasn't ready for it. I got nervous having the code live in
a branch and devised a way to land it in
main
so we could use it from PlatformApps, but still be able to keep megarepo on XRay.
The CHANGELOG sums up well where we landed:
This replaces our bespoke, XRay-based
MonadTracer
class to be that ofhs-opentelemetry. This means
Freckle.App.Database.runDB
now traces usingOpenTelemetry instead of XRay. A compilation error will indicate a missing
HasTracer
instance, which you should implement based on theFreckle.App.OpenTelemetry
module documentation.Clients who wish to remain on XRay can still upgrade, but must adjust their
imports so they use
Freckle.App.Database.XRay
instead. TheFreckle.App.Database
module is re-exported throughFreckle.App
andFreckle.App.Test
, so there may be some additionalhiding
required. Acompilation error indicating a missing
HasTracer
orMonadTracer
instancemeans your imports are not yet correct.
I've already tested using this from megarepo (staying on XRay) and progress
(opting in for tracing), so I'm relatively confident the
.XRay
module plan works.